package com.dingding.gmall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dingding.gmall.common.utils.PageUtils;
import com.dingding.gmall.product.entity.CategoryEntity;
import com.dingding.gmall.product.vo.Catelog2VO;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author liudingding
 * @email sunlightcs@gmail.com
 * @date 2020-07-02 21:58:29
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<CategoryEntity> listWithTree();

    int removeMeunByIds(List<Long> asList);

    /**
     * 找到catelogId的完整路径
     * @param catelogId
     * @return [父级id/子级id/孙级id]
     */
    Long[] findCatelogPath(Long catelogId);



    List<CategoryEntity> getLevel1Categorys();

    Map<String, List<Catelog2VO>> getCatelogJsonFromCacheWithLocalLock();

    Map<String, List<Catelog2VO>> getCatelogJsonFromCacheWithRedisLock();

    Map<String, List<Catelog2VO>> getCatelogJsonFromDB();
}

